package com.simplenix.nicasio.admin.eb;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;
import org.hibernate.annotations.Fetch;

/**
 *
 * @author fronald
 */
@Entity
@Table(name = "NIC_FEATSEC")
public class FeatureSecurity implements Serializable {

	private long secId;

	private Group group;

	private Boolean havePermission;

	private String featureName;

	/**
	 * @return the secId
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "SEC_ID")
	public long getSecId() {
		return secId;
	}

	/**
	 * @param secId the secId to set
	 */
	public void setSecId(long secId) {
		this.secId = secId;
	}

	/**
	 * @return the group
	 */
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "GROUP_ID", insertable = true, updatable = true)
	@Fetch(org.hibernate.annotations.FetchMode.JOIN)
	@Cascade(CascadeType.ALL)
	public Group getGroup() {
		return group;
	}

	/**
	 * @param group the group to set
	 */
	public void setGroup(Group group) {
		this.group = group;
	}

	/**
	 * @return the havePermission
	 */
	@Column(name = "HAVE_PERMISSION")
	public Boolean getHavePermission() {
		return havePermission;
	}

	/**
	 * @param havePermission the havePermission to set
	 */
	public void setHavePermission(Boolean havePermission) {
		this.havePermission = havePermission;
	}

	/**
	 * @return the featureName
	 */
	@Column(name = "FEAT_NAME")
	public String getFeatureName() {
		return featureName;
	}

	/**
	 * @param featureName the featureName to set
	 */
	public void setFeatureName(String featureName) {
		this.featureName = featureName;
	}

}
